<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>beforeEmbed</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>    
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>  
	<script type="text/javascript" src="../jquery.oembed.js"></script>
</head>
<body>
<script type="text/javascript">

	function addWModeParameter(oembedData) {	
		if (oembedData.type == "video") {
			var code = oembedData.code;
			var wmode = "transparent";
			if (code != null && code.indexOf("wmode") < 0) {			
				code = code.replace("<embed ", "<param name=\"wmode\" value=\"" + wmode + "\"></param>\n<embed ");
				code = code.replace("<embed ", "<embed wmode=\"" + wmode + "\"");			
			}	
			oembedData.code = code;
		}	
	}
	$(document).ready(function() {
		$(".oembed").oembed(null, { beforeEmbed: addWModeParameter });
	});
</script>
<div><a href="http://www.youtube.com/watch?v=CeacjOkLjZ0" class="oembed">YouTube Video</a></div>
</body>
</html>